package com.lw.project.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

@Controller
public class DemoController {

    @RequestMapping("/login")
    public String hello (HttpServletRequest request){

        HttpSession session = request.getSession();
        session.setAttribute("user","user");
        return "login";
    }

    @RequestMapping("/index")
    public String index (){
        return "index";
    }
}
